package state

/**
b 索引所指的是个 table, c作为key,查b，放到a
*/
func _getTabUp(i Instruction, vm LuaVM) {
	a, b, c := i.ABC()
	a += 1
	b += 1
	vm.GetRK(c)
	vm.GetTable(LuaValueIndex(b))
	vm.Replace(a)
}

func _setTabUp(i Instruction, vm LuaVM) {
	a, b, c := i.ABC()
	a += 1
	vm.GetRK(b)
	vm.GetRK(c)
	vm.SetTable(LuaValueIndex(a))
}

func _getUpVal(i Instruction, vm LuaVM) {
	a, b, _ := i.ABC()
	a += 1
	b += 1
	vm.Copy(LuaValueIndex(b), a)
}

func _setUpVal(i Instruction, vm LuaVM) {
	a, b, _ := i.ABC()
	a += 1
	b += 1
	vm.Copy(a, LuaValueIndex(b))
}
